﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Bridge
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            cmbShape.Text = "select";
            cmbDrawing.Text = "select";
            txtOut.Text = "press the button";
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (cmbShape.Text != "select" && cmbDrawing.Text != "select")
            {
                if (cmbShape.Text == "Rectangle" && cmbDrawing.Text == "DR1")
                {
                    Shape rec = new Rectangel();
                    Drawing dr = new V1Drawing();
                    txtOut.Text = rec.draw(dr);
                }
                else if (cmbShape.Text == "Rectangle" && cmbDrawing.Text == "DR2")
                {
                    Shape rec = new Rectangel();
                    Drawing dr = new V2Drawing();
                    txtOut.Text = rec.draw(dr);
                }
                else if (cmbShape.Text == "Circle" && cmbDrawing.Text == "DR1")
                {
                    Shape rec = new Circle();
                    Drawing dr = new V1Drawing();
                    txtOut.Text = rec.draw(dr);
                }
                else if (cmbShape.Text == "Circle" && cmbDrawing.Text == "DR2")
                {
                    Shape rec = new Circle();
                    Drawing dr = new V2Drawing();
                    txtOut.Text = rec.draw(dr);
                }
            }
        }
    }
}
